package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * StoreGift entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_STORE_GIFT", schema = "HCD_DEV")
public class StoreGift extends Entity implements java.io.Serializable {

	// Fields

	private StoreGiftId id;
	private StoreGoods storeGoods;
	private StorePromote storePromote;
	private Integer amount;

	// Constructors

	/** default constructor */
	public StoreGift() {
	}

	/** full constructor */
	public StoreGift(StoreGiftId id, StoreGoods storeGoods, StorePromote storePromote,
			Integer amount) {
		this.id = id;
		this.storeGoods = storeGoods;
		this.storePromote = storePromote;
		this.amount = amount;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "promoteId", column = @Column(name = "PROMOTE_ID", nullable = false, precision = 15, scale = 0)),
			@AttributeOverride(name = "storeGoodsId", column = @Column(name = "STORE_GOODS_ID", nullable = false, precision = 15, scale = 0)) })
	public StoreGiftId getId() {
		return this.id;
	}

	public void setId(StoreGiftId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_GOODS_ID", nullable = false, insertable = false, updatable = false)
	public StoreGoods getStoreGoods() {
		return this.storeGoods;
	}

	public void setStoreGoods(StoreGoods storeGoods) {
		this.storeGoods = storeGoods;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROMOTE_ID", nullable = false, insertable = false, updatable = false)
	public StorePromote getStorePromote() {
		return this.storePromote;
	}

	public void setStorePromote(StorePromote storePromote) {
		this.storePromote = storePromote;
	}

	@Column(name = "AMOUNT", nullable = false, precision = 8, scale = 0)
	public Integer getAmount() {
		return this.amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

}